//
//  GeDiaoModel.m
//  Style
//
//  Created by dllo on 15/9/23.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "GeDiaoModel.h"

@implementation GeDiaoModel

/* 2. 实现NSCoding协议方法
 
 *
 * 复杂对象归档时, 需调用的方法, 目的是将所有属性进行 编码
 */

- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:self.strAuthor forKey:@"strAuthor"];
    [aCoder encodeObject:self.strContent forKey:@"strContent"];
    [aCoder encodeObject:self.strHpId forKey:@"strHpId"];
    [aCoder encodeObject:self.strHpTitle forKey:@"strHpTitle"];
    [aCoder encodeObject:self.strMarketTime forKey:@"strMarketTime"];
    [aCoder encodeObject:self.strOriginalImgUrl forKey:@"strOriginalImgUrl"];
    [aCoder encodeObject:self.strPn forKey:@"strPn"];
    //    [aCoder encodeObject:self.urlStr forKey:@"urlStr"];
}

/*
 * 复杂对象反归档是调用, 目的是解码后 赋值给属性
 */

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {
        
        self.strAuthor = [aDecoder decodeObjectForKey:@"strAuthor"];
        self.strContent = [aDecoder decodeObjectForKey:@"strContent"];
        self.strHpId = [aDecoder decodeObjectForKey:@"strHpId"];
        self.strHpTitle = [aDecoder decodeObjectForKey:@"strHpTitle"];
        self.strMarketTime = [aDecoder decodeObjectForKey:@"strMarketTime"];
        self.strOriginalImgUrl = [aDecoder decodeObjectForKey:@"strOriginalImgUrl"];
        self.strPn = [aDecoder decodeObjectForKey:@"strPn"];
        //        self.urlStr = [aDecoder decodeObjectForKey:@"urlStr"];
        
    }
    return self;
}


@end
